<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/static/images/favicon.ico">
    <title>{% block title %}后台{% endblock %} - 管理</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css"
          integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <link href="/static/css/admin/dashboard.css" rel="stylesheet">
    {#    {% for jsfile_name in script_list_bar %}#}
    {#        <script src="{{ url_for('static', filename='/js/admin/js/'+jsfile_name+'.js') }}"></script>#}
    {#    {% endfor %}#}
    <script src="{{ url_for('static', filename='js/admin/echarts.min.js') }}"></script>
    <script src="{{ url_for('static', filename='js/admin/echarts-wordcloud.min.js') }}"></script>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/pagination.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/admin/dropdown_nav.css') }}">
    <script src="{{ url_for('static', filename='js/pagination.js') }}"></script>

    <link href="{{ url_for('static',filename='css/ionic.css') }}" rel="stylesheet">
    {#    <link rel="stylesheet" href="https://www.jq22.com/demo/Bootstrapcbcd201908172252/css/style.css">#}
    {#    <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>#}
</head>
<body>

<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{{ url_for('admin.admin') }}">Bookstore 管理</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav navbar-right">
                <li><a href="{{ url_for('orderAdmin.order_admin') }}">订单管理</a></li>
                <li><a href="{{ url_for('bookAdmin.bookAdmin') }}">图书管理</a></li>
                <li><a href="{{ url_for('userAdmin.userAdmin') }}">用户管理</a></li>
                <li><a href="{{ url_for('products.index') }}">前台页面</a></li>
                <li><a>{{ session['admin_email'] }}</a></li>
                <li><a href="{{ url_for('signIn.admin_logout') }}">退出</a></li>

            </ul>
            {% block search %}
                <form class="navbar-form navbar-right">
                    <input type="text" class="form-control" placeholder="Search...">
                    <input type="submit" class="form-control" value="搜索">
                </form>
            {% endblock %}
        </div>
    </div>
    <a href="https://github.com/caisi35/bookstore" class="github-corner" aria-label="View source on GitHub" target="_blank">
        <svg width="80" height="80" viewBox="0 0 250 250"
             style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
            <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
            <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
                  fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm">
            </path>
            <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
                  fill="currentColor" class="octo-body">
            </path>
        </svg>
    </a>
</nav>

<div class="container-fluid">
    <div class="row">
        <div class="col-sm-3 col-md-2 sidebar">
            <ul class="nav nav-sidebar">
                <li class={% if page_active == 'index' %}
                    "active"
                {% endif %}><a href="{{ url_for('admin.admin') }}">数据可视化<span class="sr-only">(current)</span></a></li>
            </ul>

            <ul class="nav nav-sidebar sidebar-nav">

                {#                <li class="{% if page_active == 'process' %}#}
                {#                    active#}
                {#                {% endif %}" role="presentation"><a href="{{ url_for('orderAdmin.process') }}" data-toggle="collapse"#}
                {#                                                    data-target="#list">订单管理</a></li>#}
                <li class="dropdown {% if is_order %}open{% endif %} {% if page_active == 'order_admin' %}active{% endif %}">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="fa fa-fw fa-plus"></i> 订单管理
                        <span class="caret"></span> </a>
                    <ul class="dropdown-menu nav-sidebar" role="menu">
                        <li class="{% if status == 1 %}active{% endif %}">
                            <a href="{{ url_for('orderAdmin.order_admin', status=1) }}">待发货订单</a>
                        </li>
                        <li class="{% if status == 0 %}active{% endif %}">
                            <a href="{{ url_for('orderAdmin.order_admin', status=0) }}">待付款订单</a>
                        </li>
                        <li class="{% if status == 6 %}active{% endif %}">
                            <a href="{{ url_for('orderAdmin.order_admin', status=6) }}">待退款订单</a>
                        </li>
                        <li class="{% if status == 2 %}active{% endif %}">
                            <a href="{{ url_for('orderAdmin.order_admin', status=2) }}">待收货订单</a>
                        </li>
                        <li class="{% if status == 3 %}active{% endif %}">
                            <a href="{{ url_for('orderAdmin.order_admin', status=3) }}">待评价订单</a>
                        </li>
                        <li class="{% if status == 4 %}active{% endif %}">
                            <a href="{{ url_for('orderAdmin.order_admin', status=4) }}">成功订单</a>
                        </li>
                        <li class="{% if status == 5 %}active{% endif %}">
                            <a href="{{ url_for('orderAdmin.order_admin', status=5) }}">失效订单</a>
                        </li>
                    </ul>
                </li>
            </ul>
            <ul class="nav nav-sidebar">
                <li class={% if page_active == 'bookAdmin' %}
                    "active"
                {% endif %}><a href="{{ url_for('bookAdmin.bookAdmin') }}">图书管理</a></li>
                <li class={% if page_active == 'off_shelf_books' %}
                    "active"
                {% endif %}><a href="{{ url_for('bookAdmin.off_shelf_books') }}">下架图书</a></li>
                <li class={% if page_active == 'add_book' %}
                    "active"
                {% endif %}><a href="{{ url_for('bookAdmin.add_book') }}">添加图书</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                <li class={% if page_active == 'userAdmin' %}
                    "active"
                {% endif %}><a href="{{ url_for('userAdmin.userAdmin') }}">用户管理</a></li>
                <li class={% if page_active == 'admin_account' %}
                    "active"
                {% endif %}><a href="{{ url_for('userAdmin.admin_account') }}">管理员账户</a></li>
            </ul>
            <ul class="nav nav-sidebar">
                {#                <li><a href="">回收站</a></li>#}
                <li class={% if page_active == 'book_trash' %}
                    "active"
                {% endif %}><a href="{{ url_for('bookAdmin.book_trash') }}">已删除图书</a></li>
                <li class={% if page_active == 'user_trash' %}
                    "active"
                {% endif %}><a href="{{ url_for('userAdmin.user_trash') }}">已删除用户</a></li>
            </ul>
        </div>

        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            {% block main %}
                {% for message in get_flashed_messages() %}
                    <div class="alert alert-warning text-center"><b>{{ message }}</b></div>
                {% endfor %}
                {#                <h1 class="page-header">可视化</h1>#}
                <div class="row placeholders dv-top">
                    <div class="col-sm-2  center-block">
                        <h3><span class="glyphicon glyphicon-shopping-cart"
                                  aria-hidden="true"></span>今日订单：{{ scales_order_data['day_order'] }}</h3></div>
                    <div class="col-sm-3  center-block">
                        <h3><span class="glyphicon glyphicon-usd"
                                  aria-hidden="true"></span>今日销售额：{{ scales_order_data['day_amount'] }}</h3></div>
                    <div class="col-sm-3  center-block">
                        <h3><span class="glyphicon glyphicon-shopping-cart"
                                  aria-hidden="true"></span>累计订单：{{ scales_order_data['total_order'] }}</h3></div>
                    <div class="col-sm-3  center-block">
                        <h3><span class="glyphicon glyphicon-usd"
                                  aria-hidden="true"></span>累计销售额：{{ scales_order_data['total_amount'] }}</h3></div>
                </div>

                <div class="row placeholders">
                    <div class="col-xs-12 col-sm-12 col-md-12 placeholder">
                        {{ line_sales|safe }}
                    </div>
                </div>

                <div class="row placeholders">
                    <div class="col-xs-12 col-sm-12 col-md-12 placeholder">
                        {{ myvisitsscatter|safe }}
                    </div>
                </div>
                <div class="row placeholders">
                    <div class="col-xs-12 col-sm-12 col-md-7 placeholder">
                        {{ myvisits_pie|safe }}
                    </div>
                    <div class="col-xs-12 col-sm-12 col-md-5 placeholder">
                        {{ mykw_wc|safe }}
                    </div>
                </div>

                <div class="row placeholders">

                    <div class="col-xs-12 col-sm-6 col-md-4 placeholder">
                        {{ myhitsbar|safe }}
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-4 placeholder">
                        {{ mysalesbar|safe }}
                    </div>
                    <div class="col-xs-12 col-sm-6 col-md-4 placeholder end_charts">
                        {{ myinte_sales|safe }}
                    </div>
                </div>
                {% block sub_header %}

                {% endblock %}
            {% endblock %}
        </div>

    </div>

</div>


<script type=text/javascript>$SCRIPT_ROOT = {{ request.script_root|tojson|safe }};</script>
<script src="{{ url_for('static', filename='js/jquery-3.5.1.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>
{#<script src="{{ url_for('static',filename='js/ionic.bundle.min.js') }}"></script>  <!-- 导致翻页click失效 -->#}
<script src="{{ url_for('static', filename='js/admin/admin_account.js') }}"></script>

{% block js_bottom %}
    <script src="{{ url_for('static', filename='js/admin/admin_bottom.js') }}"></script>
{% endblock %}
</body>
</html>